<?php
/**
 * Created by PhpStorm.
 * User: wodrow
 * Date: 18-8-10
 * Time: 下午1:55
 */

namespace appapi\modules\v0\modules\test\controllers;



use common\components\tools\ArrayHelper;
use common\rewrite\deepziyu\yii_fast_api\Controller;

class DefaultController extends Controller
{
    /**
     * test_default测试
     * @desc get/post
     * @param string $a moren xxx
     * @return array
     * @return string x test
     * @return string y y
     */
    public function actionIndex($a = 'xxx')
    {
//        $params = ArrayHelper::merge(\Yii::$app->request->get(), \Yii::$app->request->post());
//        foreach ($params as $k => $v) {
//            $p[] = $k."=".$v;
//        }
//        $str = ArrayHelper::arr2str($p, '&');
//        var_dump($str);exit;
        $r = [
            'a' => $a,
            'x' => 1,
            'y' => 1,
            'user' => \Yii::$app->user->identity->toArray(),
            'equipment' => \Yii::$app->equipmentInfo->equipment->toArray(),
            'equipmentUser' => \Yii::$app->equipmentInfo->equipmentUser->toArray(),
            'equipmentOperateLog' => \Yii::$app->equipmentInfo->equipmentOperateLog->toArray(),
        ];
        return $r;
    }
}